package com.guldan.jaina.utils;

import com.guldan.core.utils.DateUtil;
import com.guldan.jaina.dto.projectregisterupload.ProjectRegisterUploadDTO;
import com.guldan.mapper.db.entity.ProjectRegisterUpload;

/**
 * Created by Silas.
 * Date: 2016/12/3
 * Time: 16:25
 */
public class ProjectRegisterUploadDomainConvertUtils {


    public static ProjectRegisterUploadDTO convert(ProjectRegisterUpload entity) {
        ProjectRegisterUploadDTO dto = new ProjectRegisterUploadDTO();

        dto.setUploadId(entity.getUploadId());
        dto.setBatchId(entity.getBatchId());
        dto.setProjectId(entity.getProjectId());
        dto.setYear(entity.getYear());
        dto.setSuccessNum(entity.getSuccessNum());
        dto.setFailNum(entity.getFailNum());

        dto.setCreateTime(DateUtil.toLocaleString(entity.getCreateTime(), DateUtil.YYYY_MM_DD_HH_DD_SS));
        dto.setCreator(entity.getCreator());
        dto.setDelete(entity.getIsDelete());
        dto.setDisabled(entity.getDisabled());
        dto.setModifier(entity.getModifier());
        dto.setModifyTime(DateUtil.toLocaleString(entity.getModifyTime(), DateUtil.YYYY_MM_DD_HH_DD_SS));

        return dto;
    }
}
